home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 June: Reference Library / Dev.CD Jun 99 RL Disk 1.toast / Technical Documentation / Develop / develop Issue 27 / develop Issue 27 code / Internet Config Assistant / toolkit / TBitmap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-30  |  1.1 KB  |  61 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        TBitmap.h
  3.  
  4.     Contains:    A simple bitmap class
  5.  
  6.     Written by:    Arno Gourdol
  7.  
  8.     Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. #pragma once
  13.  
  14. #ifndef __TBITMAP__
  15. #define __TBITMAP__
  16.  
  17. #include "assert.h"
  18.  
  19. #include <Quickdraw.h>
  20. #include <QDOffscreen.h>
  21.  
  22. #include "TDrawContext.h"
  23.  
  24. class TBitmap : public TDrawContext
  25. {
  26. public:
  27.     TBitmap(SInt16 pictureID, UInt16 depth);
  28.     TBitmap(CRect bounds, UInt16 depth);
  29.     ~TBitmap();
  30.     
  31.     void SetBits(const void* data, UInt32 length, UInt32 offset, UInt16 depth);
  32.     void* Bits(void) const;
  33.     long BitsLength(void) const;
  34.     long BytesPerRow(void) const;
  35.     UInt16 ColorSpace(void) const;
  36.     virtual CRect Bounds(void) const;
  37.     virtual Boolean Lock(void);
  38.     virtual void Unlock(void);
  39.     inline PixMapHandle GetPixMapHandle(void) const;
  40.     inline GWorldPtr GetGWorldPtr(void) const;
  41. private:
  42.     UInt16 fRowBytes;
  43.     GDHandle fSaveGDevice;
  44.     GWorldPtr fGWorld;
  45.     CRect fBounds;
  46.     UInt16 fDepth;
  47. };
  48.  
  49. inline GWorldPtr TBitmap::GetGWorldPtr(void) const
  50. {
  51.     return fGWorld;
  52. }
  53.  
  54.  
  55. inline PixMapHandle TBitmap::GetPixMapHandle(void) const
  56. {
  57.     return ::GetGWorldPixMap(fGWorld);
  58. }
  59.  
  60.  
  61. #endif